<?php 
require_once("../include/conn.php");
$title=$_REQUEST["title"];
$tdate=$_REQUEST["tdate"];
$yssr=$_REQUEST["yssr"];
$fsjzx=$_REQUEST["fsjzx"];
$fsd=$_REQUEST["fsd"];
$ddjzx=$_REQUEST["ddjzx"];
$hczxc=$_REQUEST["hczxc"];
if($_REQUEST["wdblk"] == "")
	$wdblk=0;
$dxc=$_REQUEST["dxc"];
$dzc=$_REQUEST["dzc"];

if($_REQUEST["action"] == "update")
{	
	if(!empty($_REQUEST[id])){
		$id=$_REQUEST[id];
	}
	 $sql_rk="UPDATE `$tb_rk` SET `title` = '$title',`tdate` = '$tdate',`yssr` = '$yssr',`fsjzx` = '$fsjzx',`fsd` = '$fsd',`ddjzx` = '$ddjzx',`hczxc` = '$hczxc',`wdblk` = '$wdblk',`dzc` = '$dzc',`dxc` = '$dxc' WHERE `id` = '$id'";
	mysql_query("LOCK TABLES ".$tb_rk." WRITE");
	$cn_rk = mysql_db_query($db_name,$sql_rk);
	mysql_query("UNLOCK TABLES");
	 
 }
   
   if($_REQUEST["action"] == "add")
   {	
	$id=$_REQUEST[id];	
	$title=$_REQUEST["title"];
	$tdate=$_REQUEST["tdate"];
	$yssr=$_REQUEST["yssr"];
	$fsjzx=$_REQUEST["fsjzx"];
	$fsd=$_REQUEST["fsd"];
	$ddjzx=$_REQUEST["ddjzx"];
	$hczxc=$_REQUEST["hczxc"];
	if($_REQUEST["wdblk"] == "")
		$wdblk=0;
	
	$dxc=$_REQUEST["dxc"];
	$dzc=$_REQUEST["dzc"];
	
	$sql_rk="INSERT INTO `$tb_rk` ( `id` , `title` , `tdate`,`yssr` , `fsjzx`, `ddjzx`,`hczxc` , `wdblk`, `dzc`, `dxc`, `fsd` ) VALUES (null, '$title', '$tdate', '$yssr ', '$fsjzx', '$ddjzx', '$hczxc ','$wdblk ', '$dzc', '$dxc', '$fsd')";
	// $sql_rk="UPDATE `$tb_rk` SET `title` = '$title', = '$tdate',`` = '$yssr',`` = '$fsjzx',`` = '$ddjzx',`` = '$hczxc',`` = '$wdblk',`dzc` = '$dzc',`dxc` = '$dxc' WHERE `id` = '$id'";
	mysql_query("LOCK TABLES ".$tb_rk." WRITE");
	$cn_rk = mysql_query($sql_rk);
	mysql_query("UNLOCK TABLES");
	//$id = mysql_insert_id();	
	 
   }
   self("操作成功!","Admin_scrk.php");
 ?>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">